package com.jianyushe.jianyushebasecommon.util;

import com.jianyushe.jianyushebasecommon.exception.ParameterException;

/**
 * @author Create by Alvin
 * @Description 校验工具类  校验为假抛运行时异常
 * @date 2022-04-23 9:58
 */
public class ValidationUtils {

   public static void notNull(Object param, String message){
        isTrue(param != null, message);
   }
    /**
     * 响应自定义的业务错误
     *
     * @param condition  条件
     * @param message 消息
     */
    public static void isTrue(boolean condition, String message){
        if (!condition){
            throw new ParameterException(message);
        }
    }
}
